package cn.ibdsr.human.config;
import cn.ibdsr.human.service.DataCenterService;
import cn.ibdsr.human.service.JobService;
import cn.ibdsr.human.transfer.platform.LatestJobItem;
import cn.ibdsr.human.websocket.WebSocket;
import com.alibaba.fastjson.JSONObject;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;

@EnableScheduling
@Configuration
public class SchedulerConfig {

    @Resource
    private WebSocket webSocketServer;
    @Resource
    private DataCenterService dataCenterService;

    @Scheduled(fixedDelay = 6000)
    public void sendAdhocMessages() throws IOException {
        webSocketServer.sendMessage();
    }
}
